<html>
<head><title>Welcome to Pick and Roll!</title>

<script>
var teamFlag = "";
var PolyLines = ["","",""];
var latitudes;
var teamNames = [];
var s1;
var gameCount = [];

  var geopointArrayBefore = [];
  var geopointArrayAfter = [];

teamNames["Atlanta"] = "Hawks";
teamNames["Boston"] = "Celtics";
teamNames["Charlotte"] = "Bobcats";
teamNames["Chicago"] = "Bulls";
teamNames["Cleveland"] = "Cavaliers";
teamNames["Dallas"] = "Mavericks";
teamNames["Denver"] = "Nuggets";
teamNames["Detroit"] = "Pistons";
teamNames["Golden State"]  = "Warriors";
teamNames["Houston"] = "Rockets";
teamNames["Indiana"] = "Pacers";
teamNames["Los Angeles"] = "Clippers";
teamNames["Memphis"] = "Grizzlies";
teamNames["Miami"] = "Heat";
teamNames["Milwaukee"] = "Bucks";
teamNames["Minnesota"] = "Timberwolves";
teamNames["New Jersey"] = "Nets";
teamNames["New York"] = "Knicks";
teamNames["New Orleans"] = "Hornets";
teamNames["Oklahoma City"] = "Thunder";
teamNames["Orlando"] = "Magic";
teamNames["Philadelphia"] = "Sixers";
teamNames["Phoenix"] = "Suns";
teamNames["Portland"] = "Blazers";
teamNames["Sacramento"] = "Kings";
teamNames["San Antonio"] = "Spurs";
teamNames["Toronto"] = "Raptors";
teamNames["Utah"] = "Jazz";
teamNames["Washington"] = "Wizards";
	   
var YMAPPID = "iK0KW3PV34EtgHJ7Y_KTQe_fzqU2q7HLkox3TAiXGBlB5.8hRawN5o4D9MZB";
var plotted = [];
</script>
 <style type="text/css">  
 #map{  
   height: 100%;  
   width: 100%;  
 }  

</style>

<link rel="stylesheet" type="text/css" href="news.css">
<!-- Combo-handled YUI CSS files: -->
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.7.0/build/calendar/assets/skins/sam/calendar.css&2.7.0/build/layout/assets/skins/sam/layout.css&2.7.0/build/logger/assets/skins/sam/logger.css&2.7.0/build/menu/assets/skins/sam/menu.css">
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/reset-fonts-grids/reset-fonts-grids.css"> 
<!-- Combo-handled YUI JS files: -->
<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.7.0/build/utilities/utilities.js&2.7.0/build/calendar/calendar-debug.js&2.7.0/build/layout/layout-debug.js&2.7.0/build/logger/logger-debug.js&2.7.0/build/container/container_core-debug.js&2.7.0/build/menu/menu-debug.js"></script>
<script type="text/javascript" src="http://us.js2.yimg.com/us.js.yimg.com/lib/map/js/api/ymapapi_3_4_1_5.js"></script>
<!-- Core + Skin CSS -->
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/paginator/assets/skins/sam/paginator.css">

<!-- Dependencies --> 
<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/element/element-debug.js"></script>

<!-- Source File -->
<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/paginator/paginator-debug.js"></script>

<!-- Sam Skin CSS -->
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/container/assets/skins/sam/container.css">

<!-- Dependencies -->
<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>

<!-- OPTIONAL: Animation (only required if using ContainerEffect) -->
<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/animation/animation-debug.js"></script>

<!-- OPTIONAL: Connection (only required if using asynchronous form submission) -->
<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/connection/connection-debug.js"></script>

<!-- OPTIONAL: Drag & Drop (only required if enabling Drag & Drop) -->
<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/dragdrop/dragdrop-debug.js"></script>

<!-- OPTIONAL: YUI Button (these 2 files only required if you want SimpleDialog to use YUI Buttons, instead of HTML Buttons) -->
<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/element/element-debug.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/button/button-debug.js"></script>

<!-- Source file -->
    <script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/container/container-debug.js"></script>
    
    </head>
    <body onload="draw()" class = "yui-skin-sam" id="yahoo-com">
    <div id="top1">
    <div width = "100%" id="menuwithgroups" class="yuimenubar yuimenubarnav">
    <div class="bd">
    <ul class="first-of-type">
    <li class="yuimenuitem">&nbsp;&nbsp;&nbsp;&nbsp;Teams&nbsp;&nbsp;&nbsp;&nbsp;
      <div id = "teams" class="yuimenu">
       <div class="bd">
        <ul>
  <?php
   $teams = array("Atlanta Hawks", 
		  "Boston Celtics",
		  "Charlotte Bobcats",
		  "Chicago Bulls",
		  "Cleveland Cavaliers",
		  "Dallas Mavericks",
		  "Denver Nuggets",
		  "Detroit Pistons",
		  "Golden State Warriors",
		  "Houston Rockets",
		  "Indiana Pacers",
		  "LA Clippers",
		  "LA Lakers",
		  "Memphis Grizzlies",
		  "Miami Heat",
		  "Milwaukee Bucks",
		  "Minnesota Timberwolves",
		  "New Jersey Nets",
		  "New York Knicks",
		  "Oklahoma City Thunder",
		  "Orlando Magic",
		  "Philadelphia Sixers",
		  "Phoenix Suns",
		  "Portland Blazers",
		  "Sacramento Kings",
		  "San Antonio Spurs",
		  "Toronto Raptors",
		  "Utah Jazz",
		  "Washington Wizards");
foreach ($teams as &$current_team){
  $short_team_name = strtolower(substr($current_team, strrpos($current_team, " ") + 1));
  echo "<li class=\"yuimenuitem\" href = \"#file\"><a href=\"javascript:loadTeam('$short_team_name');\" class=\"yuimenuitemlabel\"><img style=\"display:inline\" height=\"16\" width=\"16\" border=\"0\" src=\"http://www.nba.com/media/" . $short_team_name . "_sm.gif\"/>&nbsp;$current_team</a><script type = \"text/javascript\">var $short_team_name = 0;</script></li>\n";}
?>
</ul>
</div>
</div>
</li>
</ul>
</div>
</div>	   
</div>
<div width = "400px" width = "100%" id = "center1">
  <div width = "400px" id = "map">
  </div>
  </div>				 
  <div id="pane" height = 100px>
  </div>
  </div>							   
  </div>

<div id ="right1"><div width = "100%"><table width = "100%" style="margin: 2px;"><tr width = "100%"><td align = "center" width = "50%" ><img id = "away_image"/></td><td width = "50%" align = "center" ><img id="home_image"/></td></tr></table></div>
<div id = "past_game_div">
</div>
<div id = "future_game_div">  
  </div>
  </div>
<div id="alert"></div>
  <div id = "bottom1">
  <table width = "100%"><tr><td width = "50%" style="vertical-align:middle; padding-top:3px"><b id = "teamdisplay">&nbsp;&nbsp;Choose a team from the top menu</b></td>
</tr></table></div>
</div>
<div id="loading"></div><div id="logger"></div>
<div id = "flv_box">
<div id = "flv_body">
<p id='preview'>The player will show in this paragraph</p>

<script type='text/javascript' src='swfobject.js'></script>
<script type='text/javascript'>
s1 = new SWFObject('player-viral.swf','player','576','324','9');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
//s1.addParam('flashvars','file=http://nba.cdn.turner.com/nba/big/games/celtics/2009/03/06/nba_cle_bos_0020800920_recap.nba_nba_576x324.flv');
s1.write('preview');
</script>
</div>
</div>
<div id ="mylogger"></div>
</body>
<script>	
											   
																 /*function removeTeam(teamName){
  for (val in displayedTeams){//go through dispalyed Teams array
    if (displayedTeams[val] == teamName){ //if that is the entry
      for (val2 in displayedTeamsMarkers[val]){
	  YAHOO.example.map.removeOverlay(displayedTeamsMarkers[val][val2]);
      }
      return;
    }
  }
  alert("team not found");
  }*/

function loadTeam(teamName){//enter when a team is clicked
  YAHOO.example.map.removeMarkersAll();
    addTeam(teamName);
}
															 
function addTeam(team){
  YAHOO.example.layout.getUnitByPosition("right").collapse();
  for (var i in PolyLines){
    if (PolyLines[i] != ""){
      YAHOO.example.map.removeOverlay(PolyLines[i]);
    }
  }
  document.getElementById("teamdisplay").innerHTML="&nbsp;&nbsp;Tracking " + team.substring(0,1).toUpperCase() + team.substring(1, team.length) + "...";
  
  //request the before games
  markers = [];
  YAHOO.example.loading.wait.show(); 
  if(window.XMLHttpRequest) {
    xmlhttp = new XMLHttpRequest();
  } else {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  }
  var gameArray = [];
  var gameArrayBefore = [];
  var gameArrayAfter = [];
  xmlhttp.open("GET","getSchedule.php?team=" + team + "&type=2",false); //get the previous games first
  xmlhttp.send(null);
  setTimeout("YAHOO.example.loading.wait.hide();",1000);
  var response = xmlhttp.responseText;
  var json1 = eval('(' + response + ')');
  var i, date,  oppCity, teamCity, homeTeam, awayTeam, isHome, time, location, teamScore, oppScore, marker, geopoint;
  geopointArrayBefore = [];
  geopointArrayAfter = [];
  gameCount = [];
  
  for (var game in json1){ //previous
    date = json1[game].date;
    time = json1[game].gTime;
    isHome = json1[game].isHome;
    oppCity = json1[game].oppCity;
    teamCity = json1[game].teamCity;
    location = "asdfads";
    if (isHome == "1"){
      homeCity = teamCity;
      awayCity = oppCity;
      homeScore = json1[game].hmePts;
      awayScore = json1[game].oppPts;
      location = homeCity;
    }
    else{
      homeCity = oppCity;
      awayCity = teamCity;
      homeScore = json1[game].hmePts;
      awayScore = json1[game].oppPts;
      location = homeCity;
    }
    latitude = json1[game].Latitude;
    longitude = json1[game].Longitude;
    if (typeof(gameCount[location]) == "undefined"){
      gameCount[location] = 0;
    }
    else{
      gameCount[location] = gameCount[location] + 1;
    }
    geopoint = getYgeoPoint(latitude, eval(longitude) + 1.7 * eval(gameCount[location])); //plot to the right
    gameArrayBefore.push(json1[game]);
    geopointArrayBefore.push(getYgeoPoint(latitude, longitude));
  //start plotting before days
    var parameters = "'" + awayCity + "','" + homeCity + "','" + date + "','" + awayScore + "','" + homeScore + "','" + time + "'";
    var markerMarkup = "<a href = \"javascript:loadGamePast(" + parameters + ")\"><b>Show in window</b></a>"; 
    marker = plotPointBefore(geopoint, awayCity, homeCity, date, awayScore, homeScore, time);  
    marker.addAutoExpand('<span style="font-family: arial; font-size: 14px; font-weight:bold;">' + awayCity + " vs " + homeCity + '</span><br><span style="font-family: arial; font-weight: bold;">' + awayScore + " - " + homeScore + "</span><br>Date:" + date +
			 "<br>" + markerMarkup);
    var image = new YImage();
    var opponent = json1[game].oppCode;
    var size = new YSize(80,64);
    image.src = "http://www.nba.com/images/gameInfo/full/" + opponent + ".gif";
    image.sizeImage = size;
    marker.changeImage(image);
    markers.push(marker);
  }

    var polyline = new YPolyline(geopointArrayBefore,'yellow',3,1);
    PolyLines[0] = polyline;
    YAHOO.example.map.addOverlay(polyline);
    
    xmlhttp.open("GET","getSchedule.php?team=" + team + "&type=1",false); //get the future games
    xmlhttp.send(null);
    setTimeout("YAHOO.example.loading.wait.hide();",1000);
    var response = xmlhttp.responseText;
    var json1 = eval('(' + response + ')');
    for (var game in json1){ //future
      date = json1[game].date;
      time = json1[game].gTime;
      isHome = json1[game].isHome;
      oppCity = json1[game].oppCity;
      teamCity = json1[game].teamCity;
      if (isHome == "1"){
	homeCity = teamCity;
	awayCity = oppCity;
      }
      else{
      homeCity = oppCity;
      awayCity = teamCity;
      }
      latitude = json1[game].Latitude;
      longitude = json1[game].Longitude;
      location = homeCity;
      if (typeof(gameCount[location]) == "undefined"){
	gameCount[location] = 0;
      }
      geopoint = getYgeoPoint(latitude, eval(longitude) + 1.7 * eval(gameCount[location]));
      geopointArrayAfter.push(getYgeoPoint(latitude, longitude));

      gameCount[location] = gameCount[location] + 1;
      marker = plotPointAfter(geopoint, awayCity, homeCity, date, time, location); 
      var parameters = "'" + awayCity + "','" + homeCity + "','" + date + "','" + time +  "','" + location + "'"; //away,home,date,time,location
      var markerMarkup = "<a href = \"javascript:loadGameFuture(" + parameters + ")\"><b>Show in window</b></a>"; 
      marker.addAutoExpand('<span style="font-family: arial; font-size: 14px; font-weight:bold;">' + awayCity + " vs " + homeCity + '</span><br><span style="font-family: arial; font-weight: bold;">' + date + "</span><br>Time:" + time + "<br>" + markerMarkup);

      var image = new YImage();
      var opponent = json1[game].oppCode;
      var size = new YSize(80,64);
      image.src = "http://www.nba.com/images/gameInfo/full/" + opponent + ".gif";
      image.sizeImage = size;
      marker.changeImage(image);
      markers.push(marker);
      gameArray.push(json1[game]);
      
    }




    var polyline = new YPolyline(geopointArrayAfter,'red',3,1);
    PolyLines[1] = polyline;
    YAHOO.example.map.addOverlay(polyline);

    var polyline = new YPolyline([geopointArrayBefore[geopointArrayBefore.length - 1], geopointArrayAfter[0]], 'red', 3,1);
    PolyLines[2] = polyline;
    YAHOO.example.map.addOverlay(polyline);
    var obj = YAHOO.example.map.getBestZoomAndCenter(geopointArrayBefore.concat(geopointArrayAfter));
    YAHOO.example.map.drawZoomAndCenter(obj.YGeoPoint, obj.zoomLevel);
    for(var i in markers){
      document.getElementById(markers[i]['id']).getElementsByTagName('img')[0].style.width='80px';
      document.getElementById(markers[i]['id']).getElementsByTagName('img')[0].style.height='64px';
    
    }
}

function getTeamName(city){
  return teamNames[city];
}
function loadGamePast(away, home, date, awayScore, homeScore, time){
  YAHOO.example.layout.getUnitByPosition("right").expand();
  document.getElementById("away_image").src = "http://www.nba.com/images/gameInfo/full/" + getTeamName(away).toLowerCase() + ".gif";
  document.getElementById("home_image").src = "http://www.nba.com/images/gameInfo/full/" + getTeamName(home).toLowerCase() + ".gif";
  document.getElementById("future_game_div").innerHTML = "";
  document.getElementById("past_game_div").innerHTML = '<table width = "100%" id = "scores_table" style="font-family: arial; font-size: 20px; font-weight: bold; color: navy;"><tr><td align = "center"></td><td align = "center"></td></tr><tr><td align = "center" width = "50%" ></td><td align = "center" width = "50%"></td></tr></table><hl><br><div id = "articles"><div><div style="width: 100%;"><span style="padding: 4px; font-family: arial; font-size: 18px; color: #E37400;">News</span></div><table id = "results_table" style="font-family: arial; margin: 2px"><tr>  <td style="padding: 2px; border-top:1px solid #DDDDDD;"></td></tr><tr><td style="padding: 2px; border-top:1px solid #DDDDDD;"></td></tr><tr><td style="padding: 2px; border-top:1px solid #DDDDDD;"></td></tr></table></div></div><div style="width: 100%; border-bottom: 1px solid #DDDDDD;"><span style="margin-top: 0px; padding-left: 4px; font-family: arial; font-size: 18px; color: #E37400;">Video</span></div><div id ="flv" style="margin-left: 4px; margin-top: 2px;"></div>';
  document.getElementById("scores_table").rows[0].cells[0].innerHTML = away;
  document.getElementById("scores_table").rows[0].cells[1].innerHTML = home;
  document.getElementById("scores_table").rows[1].cells[0].innerHTML = awayScore;
  document.getElementById("scores_table").rows[1].cells[1].innerHTML = homeScore;
  if(window.XMLHttpRequest) {
    xmlhttp = new XMLHttpRequest();
  } else {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  }
  var gameArray = []; 
  var awayTeam = getTeamName(away);
  var homeTeam = getTeamName(home);
  xmlhttp.open("GET","search.php?away=" + awayTeam  + "&home=" + homeTeam + "&date=" + escape(date),false); //get the previous games first
  xmlhttp.send(null);
  var json1 = eval("(" + xmlhttp.responseText + ")");
  for (var i = 0; i < 3; i++){
    document.getElementById("results_table").rows[i].cells[0].innerHTML ='<a style="color: rgb(16, 92, 182); font-size: 15px; font-weight: bold; font-family: arial;" href ="' + json1["news"][i].clickurl + 
      '" target = "_blank">' + json1["news"][i].title + "</a><br>" + json1["news"][i].abstract + "<br><br>";
  }
  var parameters = '"javascript:showVideo(\'' + json1["video"] + '\')"'
  document.getElementById("flv").innerHTML = '<div><a href=' + parameters + '><img align = "center" src="' + json1["thumbnail"] + '"/></a><br/>' + json1["description"] + "</div><br>";
  ;
  var obj = YAHOO.example.map.getBestZoomAndCenter(geopointArrayBefore.concat(geopointArrayAfter));
  YAHOO.example.map.drawZoomAndCenter(obj.YGeoPoint, obj.zoomLevel);
}
function showVideo(url){
  YAHOO.namespace("example.flv");
  s1.addParam('flashvars', 'file=' + url);
  s1.write('preview');
  YAHOO.example.flv.flv = new YAHOO.widget.Panel("flv_box",  
						 { width:"576px",
						     height:"324px",
						     fixedcenter:true, 
						     close:true, 
						     draggable:false, 
						     zindex:1000,
						     modal:true,
						     body:"flv_body",
						     visible:true
						     } 
						 );
  YAHOO.example.flv.flv.render(document.body);  
  YAHOO.util.Event.addListener("YAHOO.example.flv.flv", "hide", function (){  s1.sendEvent("STOP", true);      });
}
function loadGameFuture(away, home, date, time, location){
  YAHOO.example.layout.getUnitByPosition("right").expand();
  document.getElementById("away_image").src = "http://www.nba.com/images/gameInfo/full/" + getTeamName(away).toLowerCase() + ".gif";
  document.getElementById("home_image").src = "http://www.nba.com/images/gameInfo/full/" + getTeamName(home).toLowerCase() + ".gif";
  document.getElementById("past_game_div").innerHTML = "";
  document.getElementById("future_game_div").innerHTML = '<table id = "scores_table2" width = "100%" style="font-family: arial; font-size: 20px; font-weight: bold; color: navy;"><tr><td width = "50%" align = "center"></td><td align = "center" width = "50%"></td></tr></table><Br><div id = "game_place"><table id = "location_table" width = "100%"><tr><td align = "center" width = "50%"></td><td width = "50%" align = "center"></td></tr></table></div><br><div id="time"><table id = "time_table" width = "100%"><tr><td align = "center" width = "50%"></td><td align = "center" width = "50%"></td></tr></table></div>';
  document.getElementById("scores_table2").rows[0].cells[0].innerHTML = away;
  document.getElementById("scores_table2").rows[0].cells[1].innerHTML = home;
  document.getElementById("location_table").rows[0].cells[0].innerHTML = "Location";
  document.getElementById("location_table").rows[0].cells[1].innerHTML = location;
  document.getElementById("time_table").rows[0].cells[0].innerHTML = "Time";
  document.getElementById("time_table").rows[0].cells[1].innerHTML = time;
  var obj = YAHOO.example.map.getBestZoomAndCenter(geopointArrayBefore.concat(geopointArrayAfter));
  YAHOO.example.map.drawZoomAndCenter(obj.YGeoPoint, obj.zoomLevel);
}
function placeInfoAfter(json1, geopoint, marker, away, home, date){
  var image = new YImage();
  var opponent = json1.oppCode;
  var size = new YSize(200,200);
  image.src = "http://www.nba.com/media/" + opponent + "_sm.gif";
  image.sizeImage = size;
  marker.changeImage(image);
}
function plotPointBefore(geoPoint, away, home, date, awayScore, homeScore, time){ //plot marker, and then set some javascript for the window call
  var newMarker= new YMarker(geoPoint);  
  newMarker.setSmartWindowColor("blue");
  var parameters = "'" + away + "','" + home + "','" + date + "','" + awayScore + "','" + homeScore + "','" + time + "'";
  var markerMarkup = "<a href = \"javascript:loadGamePast(" + parameters + ")\"><b>Show in window</b></a>"; 
  /*YEvent.Capture(newMarker, EventsList.MouseClick,   
		 function(){  
		   newMarker.openSmartWindow(markerMarkup);  
		 });
  */  
  YAHOO.example.map.addOverlay(newMarker);
  return newMarker;
}
function plotPointAfter(geoPoint, away, home, date, time, location){
  var newMarker= new YMarker(geoPoint);  
  newMarker.setSmartWindowColor("blue");
  var parameters = "'" + away + "','" + home + "','" + date + "','" + time +  "','" + location + "'"; //away,home,date,time,location
  var markerMarkup = "<a href = \"javascript:loadGameFuture(" + parameters + ")\"><b>Show in window</b></a>"; 
  /*YEvent.Capture(newMarker, EventsList.MouseClick,   
		 function(){  
		   newMarker.openSmartWindow(markerMarkup);  
		   });  */
		 
  YAHOO.example.map.addOverlay(newMarker);
  return newMarker;
}
function getYgeoPoint(latitude, longitude){
  return new YGeoPoint(latitude, longitude);
}
function draw(){
  //var myLogReader = new YAHOO.widget.LogReader("myLogger");

  // YAHOO.widget.Logger.enableBrowserConsole();
      var oMenuBar = new YAHOO.widget.MenuBar(document.getElementById("menuwithgroups"), { 
                                                autosubmenudisplay: true, 
                                                hidedelay: 750, 
                                                lazyload: true });
// A DIV with id "cal1Container" should already exist on the page    
    oMenuBar.render();

    YAHOO.namespace("example.layout");
    YAHOO.example.layout = new YAHOO.widget.Layout({
      units: [
	      { position: 'top' , body: 'top1', height: '28px', scroll:null, zIndex:5},
	      { position: 'center', body:'center1', zIndex:3, collapse:false, resize: true},
	      { position: 'right',  width: 400, resize: true, collapse: true, gutter: '5px', scroll: false, body: 'right1', animate: true },
	      { position: 'bottom', height:25, body:'bottom1',  zIndex:3 }
	      ]
      });

 
    YAHOO.example.layout.render();
    YAHOO.example.layout.getUnitByPosition("right").collapse();
    
    // Create a map object  
    YAHOO.namespace("example.map");
    
    YAHOO.example.map = new YMap(document.getElementById("map"));  
    
     // Add map type control  
     YAHOO.example.map.addTypeControl();  
     YAHOO.example.map.addZoomLong();
     YAHOO.example.map.addPanControl();
   
     // Set map type to either of: YAHOO_MAP_SAT, YAHOO_MAP_HYB, YAHOO_MAP_REG  
     YAHOO.example.map.setMapType(YAHOO_MAP_REG);  
   
     // Display the map centered on a geocoded location  
     YAHOO.example.map.drawZoomAndCenter("United States", 13);  
    //If we haven't built our panel using existing markup,
    //we can set its content via script:


    //Create a SimpleDialog used to mimic an OS dialog
    var panel = new YAHOO.widget.SimpleDialog('alert', {
      fixedcenter: true,
	  visible: false,
	  modal: true,
	  width: '300px',
	  constraintoviewport: true, 
	  buttons: [
                    { text: 'OK', handler: function() {
                        panel.hide();
		      }, isDefault: true }
		    ]
	  });

    //Set the header
    panel.setHeader('Welcome to Pick and Roll');
    //Give the body something to render with
    panel.setBody('Notta');
    //Render the Dialog to the body
    panel.render(document.body);
    
    //Create a namepaced alert method
    var alert= function(str) {
      YAHOO.log('Firing panel setBody with string: ' + str, 'info', 'main.js');
      //Set the body to the string passed
      panel.setBody(str);
      //Set an icon
      panel.cfg.setProperty('icon', YAHOO.widget.SimpleDialog.ICON_INFO);
      //Bring the dialog to the top
      panel.bringToTop();
      //Show it
      panel.show();
    }  
    alert('<h5>Pick and Roll allows you to track your favorite teams. <br></h5>');
    
    YAHOO.namespace("example.container");
    YAHOO.example.container.panel2 = new YAHOO.widget.Panel("panel2", { width:"240px", 
	  height:"240px",
	  visible:false, 
	  draggable:false, 
	  x:10,
	  y:50, 
	  close:false } );
    YAHOO.example.container.panel2.setHeader("Panel #2 from Script");
    YAHOO.example.container.panel2.setBody("This is a dynamically generated Panel.");
    YAHOO.example.container.panel2.setFooter("End of Panel #2");
    YAHOO.example.container.panel2.render(document.body);
    YAHOO.example.container.panel2.bringToTop();
    //YAHOO.example.container.panel2.show();




    // Initialize the temporary Panel to display while waiting for external content to load
    YAHOO.namespace("example.loading");
    YAHOO.example.loading.wait = new YAHOO.widget.Panel("loading",  
							{ width:"240px", 
							    fixedcenter:true, 
							    close:false, 
							    draggable:false, 
							    zindex:1000,
							    modal:true,
							    visible:false
							    } 
							);
    
    YAHOO.example.loading.wait.setHeader("Loading, please wait...");
    YAHOO.example.loading.wait.setBody('<img src="http://l.yimg.com/a/i/us/per/gr/gp/rel_interstitial_loading.gif" />');
    YAHOO.example.loading.wait.render(document.body);    


    // Instantiate a Panel from script
    YAHOO.namespace("example.container");
}

</script>
